package cn.iocoder.yudao.module.ai.dal.mysql.busimodel;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ai.dal.dataobject.busimodel.BusiModelDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ai.controller.admin.busimodel.vo.*;

/**
 * 业务模型 Mapper
 *
 * @author gt
 */
@Mapper
public interface BusiModelMapper extends BaseMapperX<BusiModelDO> {

    default PageResult<BusiModelDO> selectPage(BusiModelPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BusiModelDO>()
                .eqIfPresent(BusiModelDO::getJupyterId, reqVO.getJupyterId())
                .likeIfPresent(BusiModelDO::getModelName, reqVO.getModelName())
                .eqIfPresent(BusiModelDO::getModelDesc, reqVO.getModelDesc())
                .eqIfPresent(BusiModelDO::getDependentOnModelOutput, reqVO.getDependentOnModelOutput())
                .eqIfPresent(BusiModelDO::getBelongModelType, reqVO.getBelongModelType())
                .eqIfPresent(BusiModelDO::getModelOutputJson, reqVO.getModelOutputJson())
                .eqIfPresent(BusiModelDO::getModelNameChiness, reqVO.getModelNameChiness())
                .eqIfPresent(BusiModelDO::getModelTypes, reqVO.getModelTypes())
                .orderByDesc(BusiModelDO::getId));
    }

}